<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.online.*,com.hs.auth.*" pageEncoding="utf-8"%>
<%
HsAccount accInfo = (HsAccount)request.getSession().getAttribute(AUTHConstant.USERINSESSION);
String accid = String.valueOf(accInfo.getId());
String lang = accInfo.getCreatuser() + "";
HsUserinfo userinfo = accInfo==null?null:accInfo.getUserinfo();
Map authMap = (Map)request.getSession().getAttribute("USERPOWER_"+accInfo.getId());
if(authMap == null)
	authMap = new HashMap();
String authstr = null;
String systemstr = null; 
 //String username = (String)request.getAttribute("username"); 
  System.out.println(authMap);
boolean isadmin = "system".equals(accInfo==null?"":accInfo.getLoginid());
boolean role1 = (authMap.get("WDSS_ROLE01")!=null);
boolean role2 = (authMap.get("WDSS_ROLE02")!=null); 
boolean role3 = (authMap.get("WDSS_ROLE03")!=null);
boolean role4 = (authMap.get("WDSS_ROLE04")!=null); 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../include.jsp"%>  
<script src="<%=basePath %>common/javascript/common.js"></script>
<script src='<%=basePath%>dwr/interface/standarddwr.js'></script> 
 <script language=JavaScript> 
var myDate = new Date();
   // myDate.getYear();       //获取当前年份(2位)
  //  myDate.getFullYear();   //获取完整的年份(4位,1970-????)
  //  myDate.getMonth();      //获取当前月份(0-11,0代表1月)
  //  myDate.getDate();       //获取当前日(1-31)
  //  myDate.getDay();        //获取当前星期X(0-6,0代表星期天)
 //   myDate.getTime();       //获取当前时间(从1970.1.1开始的毫秒数)
 //   myDate.getHours();      //获取当前小时数(0-23)
 //   myDate.getMinutes();    //获取当前分钟数(0-59)
 //   myDate.getSeconds();    //获取当前秒数(0-59)
 //   myDate.getMilliseconds();   //获取当前毫秒数(0-999)
 //   myDate.toLocaleDateString();    //获取当前日期
 //   var mytime=myDate.toLocaleTimeString();    //获取当前时间
 //   myDate.toLocaleString( );       //获取日期与时间 
 
// 显示服务器的当前时间
var OA_TIME = new Date( myDate.getFullYear(),myDate.getMonth(),myDate.getDate(),myDate.getHours(),myDate.getMinutes(),myDate.getSeconds());
function timeview()
{
  timestr=OA_TIME.toLocaleString(); 
  //timestr=timestr.substr(timestr.indexOf(":")-2);
  document.getElementById("Head1Right_Time").innerHTML = timestr;
  OA_TIME.setSeconds(OA_TIME.getSeconds()+1);
  window.setTimeout( "timeview()", 1000 );
   
}

function modifyUserinfo(){
   var pageURL = "<%=basePath %>auth/modifyUserinfo.do?uid=<%=accid %>";
   openwindow(pageURL,'800','600','修改个人信息'); 
}
 //数据检索
 function dataSearch(){
	<% 
	
	if(role1 || role2 || isadmin){
	%>
		//window.parent.cont.frameElement.src  = "<%=basePath %>search/mainframe.do";
		//window.parent.cont.frameElement.src  = "<%=basePath %>search/sindexFrame.do";
		alert("开发中......");
	<%}else{%>
	   alert("开发中......");
	<%}%>
 }
//系统管理
 function systemManage(){ 
	<% 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/system/systemframe.jsp";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
 //古籍数据导入
 function dataManage(){ 
 	<%
 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>data/dataListFrame.do";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
  //期刊数据导入
 function datamagaManage(){ 
 	<%
 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>data/datamagaListFrame.do";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
 
   //数据加工
 function dataProduce(){
	<%
	 
	if(role3 || role4 || role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>produce/dataprolist.do";
	<%}else{%>
	   alert("权限不足!");
	<%}%>
 }
 //标准管理
 function standerManage(){ 
	<%
	 
	if(role1|| isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/standard/standardframe.jsp";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
  //用户管理
 function userManage(){ 
	<% 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>auth/userFrame.do";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
 //数据字典管理
 function dictManage(){ 
	<% 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath%>dict/dictmanage.do";
	<%}else{%>
	   alert("权限不足!");
	<%}%> 
 }
</script>
</head>
<body>
	<div class="head">
    	<img src="<%=imagePath %>logo.gif" class="logo"/>
    	<div class="user">欢迎您：<strong><%=userinfo.getUsername()%></strong></div>
    	<div class="banner"></div>
    	<div class="head_right">
            <a href="javaScript:modifyUserinfo();"><img src="<%=imagePath %>ico_modify.gif" />修改个人信息</a>
            <a href="<%=basePath %>logout.do"><img src="<%=imagePath %>ico_exit.gif" />退出系统</a>
        </div>
   	 	<div class="nav">
   	 	     <a href="javaScript:dataSearch()" ><span>医案相似度识别</span> </a>
   	 	    <a href="javaScript:dataProduce()" class="curr" ><span>数据加工</span></a>
        	<a href="javaScript:dataManage()" ><span>古籍数据导入</span></a>
        	<a href="javaScript:datamagaManage()" ><span>期刊数据导入</span></a> 
            <a href="javaScript:standerManage()"><span>标准数据管理</span></a> 
            <!--a href="javaScript:systemManage()"><span>系统管理</span></a-->
            <a href="javaScript:userManage()" ><span>用户管理</span></a>
   			<a href="javaScript:dictManage()" ><span>数据字典</span></a>
        </div>
	</div>
</body>
</html>
